package com.sjgame.base.common;

import org.springframework.data.domain.Page;

/**
 * @program: shgame
 * @description:
 * @author: zcl
 * @create: 2018-07-02 14:43
 **/
public class PageByBootStarp<T> {
    private long total;
    private Object rows;

    public long getTotal() {
        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    public Object getRows() {
        return rows;
    }

    public void setRows(Object rows) {
        this.rows = rows;
    }

    public PageByBootStarp<T> formatResult(Page<T> page){

        this.setTotal(page.getTotalElements());
        this.setRows(page.getContent());
        return  this;
    }

}
